import { Injectable } from "@nestjs/common";

@Injectable()
export class PageRenderService {
  constructor() {}

  htmlTip(pageTitle: string, messageTitle: string, message: string) {
    return `
    <html>
      <head>
        <title>${pageTitle}</title>
        <link rel="stylesheet" href="/css/style.css">
      </head>
      <body>
        <div style="width: 60vw;margin: auto;margin-top: 30vh;transform: translateY(-50%);">
          <h1 style="text-align: center;overflow-wrap: break-word;">${messageTitle}</h1>
          <h3 id="message" style="width: 80%;margin: auto;text-align: center;overflow-wrap: break-word;margin-top: 1em;">
            ${message}
          </h3>
        </div>
      </body>
    </html>
  `;
  }

  html404() {
    return this.htmlTip("404", "404", "Sorry can't find that!");
  }
}
